/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cz.dusa.switco;

/**
 * Event is a place, where an active equality tree can hit another active equality tree (MERGE)
 * or where it should be splitted (SPLIT), because otherwise it wouldn't be active equality tree anymore or
 * where it lies the optimum of the active equality tree (FIX). See {@link #getType()} to check which one of these
 * possibilities is this event. In case of constant cost function or cost function with plateau, the
 * possibility EventType.FIX can define a event with time interval from {@link #getLeftTime()} to
 * see {@link #getRightTime()}. In other cases these two time points should be equal each other.
 * @author vdusa
 */
public class Event {
    private Double time;
    private Precedence precedence;
    private EventType type;

    public Event(Double time, Precedence precedence, EventType type){
        setTime(time);
        setPrecedence(precedence);
        setType(type);
    }

    /**
     * @return the time point of the event
     */
    public Double getTime() {
        return time;
    }

    /**
     * @param leftTime time point to set
     */
    public final void setTime(Double time) {
        this.time = time;
    }

    /**
     * @return the precedence
     */
    public Precedence getPrecedence() {
        return precedence;
    }

    /**
     * @param precedence the precedence to set
     */
    private void setPrecedence(Precedence precedence) {
        this.precedence = precedence;
    }

    /**
     * @return the type of the event. See {@link EventType}
     */
    public EventType getType() {
        return type;
    }

    /**
     * @param type of the event to set
     */
    private void setType(EventType type) {
        this.type = type;
    }
}
